import React from 'react';
import { View, Text } from '@tarojs/components';
import { getLicenseIcon } from './lisenceIcons';

interface LicenseTagsProps {
  licenseItems: string[];
  className?: string;
}

/**
 * 许可证标签组件
 * @param {LicenseTagsProps} props - 组件属性
 * @returns {JSX.Element} 渲染的许可证标签组件
 */
export const LicenseTags: React.FC<LicenseTagsProps> = ({ licenseItems, className = ''}) => {
  if (!licenseItems || licenseItems.length === 0) {
    return null;
  }

  return (
    <View className={`license-tags ${className}`}>
      {licenseItems.map((license, index) => (
        <View
          key={index}
          className='orange-tag text-xs'
          style={{ marginRight: '8rpx', marginTop: '3rpx' }}
        >
          {/* {getLicenseIcon(license)} */}
          <Text className='text-sm'>{license}</Text>
        </View>
      ))}
    </View>
  );
};

export default LicenseTags;